from django.urls import path
from . import views
app_name = 'user'
urlpatterns = [
    # 127.0.0.1:8000/register/
    path('register/',views.RegisterView.as_view(),name = 'register'), # 注册
    path('login/',views.LoginView.as_view(),name = 'login'), # 登录
    path('logout/',views.LogoutView.as_view(),name = 'logout'), # 登出
    path('info/',views.InfoView.as_view(),name = 'info'), # 用户中心
    path('emails/',views.SaveEmailView.as_view(),name = 'save_email'), # 保存邮箱
    path('emails/verification/',views.VerifyEmailView.as_view(),name = 'verify_email'), # 验证邮箱
    path('addresses/',views.AddressesView.as_view(),name = 'address'), # 收货地址
    path('addresses/create/',views.AddressesCreateView.as_view(),name = 'create_address'), # 新增收货地址
    path('addresses/<int:address_id>/', views.UpdateDeleteAddressesView.as_view(), name='update_del_address'),  # 编辑及删除收货地址
    path('addresses/<int:address_id>/default/', views.DefaultAddressesView.as_view(), name='default_address'),  # 设置默认收货地址
    path('addresses/<int:address_id>/title/', views.AddressesTitleView.as_view(), name='address_title'),  # 设置收货地址标题
    path('password/', views.ChangePasswordView.as_view(), name='change_password'),  # 修改用户登录密码
    path('usernames/<str:username>/count/',views.CheckUsernameView.as_view()),
    path('mobiles/<str:mobile>/count/',views.CheckMobileView.as_view()),
    path('browse_histories/',views.BrowseHistoryView.as_view()),# 用户浏览记录
    path('orders/info/<int:page_num>/',views.OrderInfoView.as_view()),# 全部订单
]